package com.nl.controller.sms5g.controller;

import com.nl.controller.common.util.BaseResult;
import com.nl.controller.sms5g.bean.bo.CreateSendRangeBo;
import com.nl.controller.sms5g.bean.bo.New5gTemplateSyncBo;
import com.nl.controller.sms5g.bean.bo.Update5gTemplateSyncBo;
import com.nl.controller.sms5g.service.Sms5gTemplateService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @desc
 * @return null
 * @author l
 * @date 2021/6/8 19:35
 */
@RestController
@Slf4j
@RequestMapping("/template")
@Validated
public class Sms5gTemplateController {
    
    @Autowired
    private Sms5gTemplateService sms5gTemplateSyncService;
    
    /**
     * @desc 新增多媒体模板同步
     * @param new5gTemplateSyncBo 
     * @return com.nl.controller.common.util.BaseResult
     * @author l
     * @date 2021/6/8 19:52
     */
    @RequestMapping("/create5GTemplateSync")
    public BaseResult newTemplateSync(@RequestBody @Validated New5gTemplateSyncBo new5gTemplateSyncBo){
        BaseResult baseResult = sms5gTemplateSyncService.newTemplateSync(new5gTemplateSyncBo);
        return  baseResult;
    }

    /**
     * @desc 变更多媒体模板同步
     * @param update5gTemplateSyncBo
     * @return com.nl.controller.common.util.BaseResult
     * @author l
     * @date 2021/6/8 19:52
     */
    @RequestMapping("/update5GTemplateSync")
    public BaseResult updateTemplateSync(@RequestBody Update5gTemplateSyncBo update5gTemplateSyncBo){
        BaseResult baseResult = sms5gTemplateSyncService.updateTemplateSync(update5gTemplateSyncBo);
        return  baseResult;
    }
    
    /**
     * @desc 查询5g多媒体模板信息
     * @param mgrId 
     * @return com.nl.controller.common.util.BaseResult
     * @author l
     * @date 2021/6/15 10:42
     */
    @RequestMapping("/qry5GTemplateInfo")
    public BaseResult qry5GTemplateInfo( @RequestParam(value = "mgrId", required = true)String mgrId){
        BaseResult baseResult = sms5gTemplateSyncService.qry5GTemplateInfo(mgrId);
        return baseResult;
    }
    
    /**
     * @desc 新建5G多媒体项目发送范围
     * @param createSendRangeBo 
     * @return com.nl.controller.common.util.BaseResult
     * @author l
     * @date 2021/6/17 17:22
     */
    @RequestMapping("/createSendRange")
    public BaseResult createSendRange(@RequestBody CreateSendRangeBo createSendRangeBo){
        BaseResult baseResult = sms5gTemplateSyncService.createSendRange(createSendRangeBo);
        return  baseResult;
    }


}
